Working with PrizmDoc > Developer Guide > PrizmDoc Application Services > Viewing Packages |
Pre-Conversion Services are included as a "Developer Preview." This feature is in late-stage development and API's marked as such should be used for evaluation purposes only and should not be used in production deployments. Note that these API's may undergo change prior to feature completion. The Pre-Conversion Services will be feature complete in PrizmDoc version 11.2. |
PrizmDoc Application Services v11.0 introduces the Viewing Packages feature. A Viewing Package is a cached version of a document that the PrizmDoc Viewer will use when viewing a document. Viewing a document from a Viewing Package will significantly reduce the load on PrizmDoc Server and will allow you to serve many more users per minute than you would otherwise be able to.
A Viewing Package can be created through Pre-Conversion or by using On-Demand Caching.
This topic provides information about the following:
Viewing Packages are stored in both the filesystem and configured database. If using multiple instances of PAS, you must use a shared database and NAS (Network Attached Storage). The Running PrizmDoc Application Services on Multiple Servers topic can provide more information for configuring PAS in Multi-Server Mode.
By default, storage is configured in the following way:
Config Key |
Storage Provider |
Description |
---|---|---|
viewingPackagesData |
database |
Data about a Viewing Package. This is the data that can be retrieved from GET /v2/viewingPackages. |
viewingPackagesProcesses |
database |
Data about a Viewing Package creator process. This is the data that can be retrieved from GET /v2/viewingPackageCreators. |
viewingSessionsData |
database |
Data about a Viewing Session. When creating a Viewing Session, an entry is added to this table. |
viewingSessionsProcessesMetadata |
database |
Data about processes for a Viewing Session. This is currently used for content conversion and markup burner processes. |
viewingPackagesArtifactsMetadata |
database |
Metadata for a viewing package artifact. This is used to find specific artifacts for a package and contains the artifact type, the file name in the filesystem among other important information. |
viewingPackagesArtifacts |
filesystem |
Artifacts for a Viewing Package. These include SVG and raster content for every page, the source document, and other artifacts the Viewing Client will likely request. |
Viewing Packages are opt-in and require special configuration to work properly. At a minimum, your configuration should include the following:
Copy Code
|
|
---|---|
# Feature toggles feature.viewingPackages: "enabled"
database.adapter: "sqlserver" database.host: "localhost" database.port: 1433 database.user: "pasuser" database.password: "password" database.database: "PAS"
defaults.viewingSessionTimeout: "20m"
viewingPackagesProcesses.storage: "database" viewingSessionsData.storage: "database" viewingSessionsProcessesMetadata.storage: "database"
viewingPackagesArtifacts.storage: "filesystem" viewingPackagesArtifacts.path: "/usr/share/prizm/Samples/viewingPackages" |
Creating a Viewing Package through Pre-Conversion provides a way to generate packages whenever it makes the most sense for your application to do so. It allows you to make use of down-time for Pre-Conversion to reduce load in high traffic periods. Pre-Conversion does all the work of creating a Viewing Package whenever it is requested. It starts a process that will begin downloading content and allow you to poll for progress.
It is recommended that you maintain a queue of Pre-Conversions so you don’t overload the server and have faster turnaround time. We recommend a maximum of 5 Pre-Conversion processes at a time per PrizmDoc Application Services and PrizmDoc Server instance. This will allow packages to be created quickly while maintaining a sustainable load.
For a step-by-step process, go to the Pre-Converting Documents topic.
Creating a Viewing Package through On-Demand Caching is a seamless process through the Viewing Session API. On-Demand Caching allows you to trigger a Viewing Package creation process in the background and use the resulting Viewing Package when it is ready. This feature is designed to allow immediate viewing using PrizmDoc Server while caching a package for subsequent views of the same document.
As an example, consider this request for a Viewing Session:
Copy Code
|
|
---|---|
POST /ViewingSession { "source": { "documentId": "PdfDemoSample-a1b0x19n2", "type": "document", "fileName": "PdfDemoSample.pdf" } } |
This request will always return a viewingSessionId
regardless of the status of the matching Viewing Package. If a Viewing Package does not currently exist with the given documentId
, PrizmDoc Server will handle document viewing while a background process creates a Viewing Package. Once the background process is complete, PrizmDoc Application Services will handle all further viewing sessions until the Viewing Package expires (24 hours by default).